import VueRouter from "vue-router";

// 导入对应的路由组件
const homePage = () => import('../components/homePage.vue')
const scenery = () => import('../components/scenery/scenery.vue')
const score = () => import('../components/scenery/score.vue')
const presentation = () => import('../components/scenery/presentation.vue')
const strategy = () => import('../components/strategy/strategy.vue')
const hot = () => import('../components/hot/hot.vue')
const team = () => import('../components/team/team.vue')
const details = () => import('../components/team/details.vue')
const article = () => import('../components/strategy/article.vue')
const write = () => import('../components/write/write.vue')
const show = () => import('../components/write/show.vue')
const seek = () => import('../components/seek/seek.vue')
const news = () => import('../components/person/news.vue')
const install = () => import('../components/person/install.vue')
const collect = () => import('../components/person/collect.vue')
const articleList = () => import('../components/person/articleList.vue')
const login = () => import('../components/login/login.vue')
const register = () => import('../components/login/register.vue')
const dl = () => import('../components/login/dl.vue')
const look = () => import('../components/team/look.vue')

// 3. 创建路由对象
var router = new VueRouter({
    // mode: 'history',  //http://localhost:3000/#/  去掉#
    routes: [
        //配置路由规则
        {
            path: "/",
            redirect: "/home"
        }, {
            path: '/home',
            name: 'home',
            component: homePage
        }, {
            path: '/scenery',
            component: scenery,
            children: [{
                path: '/scenery',
                component: presentation
            }, {
                path: '/scenery/presentation',
                component: presentation
            }, {
                path: '/scenery/score',
                component: score
            }]
        }, {
            path: '/strategy',
            component: strategy
        }, {
            path: '/hot',
            component: hot
        }, {
            path: '/team',
            component: team
        }, {
            path: '/write',
            component: write
        }, {
            path: '/show',
            component: show
        }, {
            path: "/strategy/article",
            component: article
        }, {
            path: "/seek",
            component: seek
        }, {
            path: "/person/news",
            component: news
        }, {
            path: "/person/articleList",
            component: articleList
        }, {
            path: "/person/install",
            component: install
        }, {
            path: "/person/collect",
            component: collect
        }, {
            path: "/details",
            component: details
        }, {
            path: '/dl',
            component: dl,
            children: [{
                path: '/dl',
                component: login
            }, {
                path: '/dl/login',
                component: login
            }, {
                path: '/dl/register',
                component: register
            }]
        }, {
            path: '/team/look',
            component: look
        }
    ],
    // linkActiveClass: "mui-active" // 覆盖默认的路由高亮的类，默认的类叫做 router-link-active
});

// 把路由对象暴露出去
export default router